package collection;

import com.google.common.base.Function;
import com.google.common.collect.Collections2;

import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

/**
 * @author Created by chenxin34 on 2018/10/29 下午12:05.
 */
public class Collections2Test {
    public static void main(String[] args) {
        Set<Long> poiIds = new HashSet<>();
        poiIds.add(1L);

        final Collection<String> transformPoiIds2String = Collections2.transform(poiIds, new Function<Long, String>() {
            @Override
            public String apply(Long input) {
                return String.valueOf(input);
            }
        });
        String[] dimensionValues = new String[poiIds.size()];
        transformPoiIds2String.toArray(dimensionValues);

        System.out.println(dimensionValues.length);
        System.out.println(dimensionValues[0]);
    }
}
